package com.example.designpattenexample.flyweight.example;

public class ChesspieceFactory {

    private static ChesspieceFlyweight WHITE = new ChesspieceFlyweight("WHITE");
    private static ChesspieceFlyweight BLACK = new ChesspieceFlyweight("BLACK");

    public static Chesspiece getChesspiece(String color){
        if ("WHITE".equals(color)){
            return WHITE;
        }else if ("BLACK".equals(color)){
            return BLACK;
        }
        return null;
    }

}
